package com.sakura.oj.model.enums;

import lombok.Getter;

/**
 * 题目提交语言枚举
 *
 * @author Sakura
 */
@Getter
public enum ProblemSubmitLanguageEnum {

    JAVA("Java", "Java"),
    GOLANG("Go", "Golang"),
    CPP("Cpp", "C++"),
    PYTHON3("Python", "Python3");

    final String value;
    final String text;

    ProblemSubmitLanguageEnum(String value, String text) {
        this.value = value;
        this.text = text;
    }

    public static ProblemSubmitLanguageEnum getEnumByValue(String value) {
        if (value == null) {
            return null;
        }
        for (ProblemSubmitLanguageEnum problemSubmitLanguageEnum : ProblemSubmitLanguageEnum.values()) {
            if (problemSubmitLanguageEnum.value.equals(value)) {
                return problemSubmitLanguageEnum;
            }
        }
        return null;
    }

}
